<template>
	<view>
		<u-navbar title="千一赠送明细" :autoBack="true" :placeholder="true" leftIconColor="#ffffff" :titleStyle="{color: '#ffffff'}" bgColor="#e60000" class="navBarHeight">
		</u-navbar>
		<view class="padding-sm border-bottom" v-for="(item, index) in qianyiLogList" :key="index">
			<view class="flex justify-between font-14 text-bold">
				<view>
					<text v-if="item.releasedType == 1">正常赠送</text>
					<text v-if="item.releasedType == 2">加速赠送</text>
				</view>
				<view class="text-theme">￥{{item.releasedAmount}}</view>
			</view>
			<view class="padding-top-xs text-gray" v-if="item.releasedType == 2">来源订单：{{item.assistanceOrderId}}</view>
			<view class="padding-top-xs text-gray">
				到账钱包：<text v-for="(cItem, cIndex) in walletTypeList" :key="cIndex" v-if="item.walletId == cItem.value">{{cItem.label}}</text>
			</view>
			<view class="padding-top-xs text-gray">发放时间：{{item.releasedTime}}</view>
			<view class="padding-top-xs text-gray">发放流水号：{{item.walletFlowId}}</view>
			
			<view class="padding-top-xs text-gray">创建时间：{{item.createTime}}</view>
		</view>
		<u-loadmore :status="status" class="padding-bottom" />
	</view>
</template>

<script>
	import {
		qianyiLog
	} from '@/common/api/order.js'
	import {
		walletTypeList
	} from '@/common/api/dict.js'
	export default {
		data() {
			return {
				pageNo: 0,
				qianyiLogList: [],
				walletTypeList: walletTypeList,
				status: 'loading',
				logId: ''
			};
		},
		onLoad(options) {
			this.logId = options.logId
			this.getQianyiLog()
		},
		onReachBottom() {
			this.getQianyiLog()
		},
		methods: {
			getQianyiLog() {
				this.pageNo++
				this.status = 'loading'
				qianyiLog(this.logId,{pageNo: this.pageNo, pageSize: 10}).then(res => {
					this.qianyiLogList = this.qianyiLogList.concat(res.data)
					if (res.data.length < 10) {
						this.status = 'nomore'
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
